package com.hsgene.shoppingcar.service;

import com.hsgene.shoppingcar.domain.ShoppingCarInfo;
import com.hsgene.shoppingcar.dto.ShoppingCarInfoDto;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @Author: wangxuefeng@hsgene.com
 * @Description:
 * @Date: Created in 15:49 2018/7/16
 * @Modified By:
 */
public interface ShoppingCarService {
    /**
     * 加入购物车
     *
     * @param carInfo 商品信息
     * @return
     */
    int insert(ShoppingCarInfo carInfo);

    /**
     * 查询购物车
     *
     * @param userId 用户ID
     * @return
     */
    Map<String, Object> queryShoppingCarByUserId(String userId);

    /**
     * 删除购物车物品
     *
     * @param shoppingCarId 购物车ID
     * @param userId        用户id
     * @return
     */
    Map<String, Object> deleteShoppingCar(String shoppingCarId, String userId);

    /**
     * 更新购物车信息
     *
     * @param infoDtoList 更新信息
     * @param userId      用户id
     * @return
     */
    Map<String, Object> updateShoppingCar(@RequestBody List<ShoppingCarInfoDto> infoDtoList, String userId);

}
